#include <stdio.h>
#include <stdlib.h>
int main()
{
    pid_t id = fork();
    if(id < 0)
    {
        perror("fork");
        return 1;
    }
    if(id ==  0)
    {
        printf("父进程[%d],Z状态\n",getpid());
        sleep(5);
        exit(0);
    }else{
        printf("子进程[%d],正在休眠\n",getpid());
        sleep(20);
    }
    return 0;
}
